package com.itlong.Controller;


import com.itlong.Pojo.Result;
import com.itlong.Util.JwtUtil;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/user")
public class UserList {

    @GetMapping("/list")
    public Result<String> getUserList(@RequestHeader(name = "Authorization") String token, HttpServletResponse response) {

        try {
            Map<String, Object> claims = JwtUtil.parseToken(token);
            return Result.success("这是所有文章。。。。。。");
        } catch (Exception e) {
            response.setStatus(401);
            return Result.error("未登录");
        }
    }
}
